From: Rui Matos Date: Wed, 3 Aug 2011 18:05:53 +0000 (+0100) Subject: network: always coerce the SSID to _something_ X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~1013^2^2~7946 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=60b54c0052228162e76b8a8d3d3455eee366d7c9;p=gnome-shell.git network: always coerce the SSID to _something_ https://bugzilla.gnome.org/show_bug.cgi?id=654898 --- diff --git a/js/ui/status/network.js b/js/ui/status/network.js index 341f9b0e8..3f3806229 100644 --- a/js/ui/status/network.js +++ b/js/ui/status/network.js @@ -102,6 +102,13 @@ function sortAccessPoints(accessPoints) { }); } +function ssidToLabel(ssid) { + let label = NetworkManager.utils_ssid_to_utf8(ssid); + if (!label) + label = _(""); + return label; +} + function NMNetworkMenuItem() { this._init.apply(this, arguments); } @@ -117,10 +124,7 @@ NMNetworkMenuItem.prototype = { if (!title) { let ssid = this.bestAP.get_ssid(); - if (ssid) - title = NetworkManager.utils_ssid_to_utf8(ssid); - if (!title) - title = _(""); + title = ssidToLabel(ssid); } this._label = new St.Label({ text: title }); @@ -1002,7 +1006,7 @@ NMDeviceWireless.prototype = { item: null, accessPoints: [ ap ] }; - obj.ssidText = NetworkManager.utils_ssid_to_utf8(obj.ssid); + obj.ssidText = ssidToLabel(obj.ssid); this._networks.push(obj); } @@ -1219,7 +1223,7 @@ NMDeviceWireless.prototype = { item: null, accessPoints: [ accessPoint ] }; - apObj.ssidText = NetworkManager.utils_ssid_to_utf8(apObj.ssid); + apObj.ssidText = ssidToLabel(apObj.ssid); needsupdate = true; }